<?php
$this->breadcrumbs=array(
	'Testimonials'=>array('index'),
	'Manage',
);

$this->menu=array(
	array('label'=>'List Testimonials', 'url'=>array('index')),
	array('label'=>'Create Testimonials', 'url'=>array('create')),
);

Yii::app()->clientScript->registerScript('search', "
$('.search-button').click(function(){
	$('.search-form').toggle();
	return false;
});
$('.search-form form').submit(function(){
	$.fn.yiiGridView.update('testimonials-grid', {
		data: $(this).serialize()
	});
	return false;
});
");
?>

<h1>Manage Testimonials</h1>

<div class="search-form" >
<?php $this->renderPartial('_search',array(
	'model'=>$model,
)); ?>
</div><!-- search-form -->

<?php $this->widget('zii.widgets.grid.CGridView', array(
	'id'=>'testimonials-grid',
	'dataProvider'=>$model->search(),
	'columns'=>array(
		array(
		'name'=>'tmID',
		'value'=>'$data->tmID',
		'htmlOptions'=>array('style'=>'width:50px'),
		),
		array(
		'name'=>'vendorID',
		'value'=>'Vendor::model()->getModel("VENDOR-ID",array("vendorID"=>$data->vendorID))->vendor_name',
		'htmlOptions'=>array('style'=>'width:200px'),
		),
		array(
		'name'=>'userID',
		'value'=>'User::model()->getModel("USER-ID",array("userID"=>$data->userID))->first_name." ".User::model()->getModel("USER-ID",array("userID"=>$data->userID))->last_name',
		'htmlOptions'=>array('style'=>'width:200px'),
		),
		'testimonial',
				array(
		'name'=>'screened',
		'value'=>'ApplicationConfig::app()->params["testimonial"]["show-on-screen"][$data->screened]',
		'htmlOptions'=>array('style'=>'width:100px'),
		),
		array(
			'class'=>'CButtonColumn',
			'template'=>'{update}{delete}'
		),
	),
)); ?>
